package com.example.project.volley;

import com.example.project.bean.AccountBean;
import com.example.project.bean.UserBean;

import java.util.HashMap;
import java.util.Map;

public class Params {
    /*
     *函数名：HashMap
     * 功 能：返回用户登录的参数
     * 参  数：String acount, String pass
     * 返回值：HashMap
     */
    public static HashMap<String, String> Login(String acount, String pass) {
//        HashMap<String, String> map = getHeader();
//        map.put("status", status);
        Map<String, String> map = new HashMap<String, String>();
        map.put("username", acount);
        map.put("password", pass);
        return (HashMap<String, String>) map;
    }


    /*
     *函数名：HashMap
     * 功 能：返回用户注册是否重复
     * 参  数：String acount, String pass
     * 返回值：HashMap
     */
    public static HashMap<String, String> Register(UserBean userBean) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("name",userBean.getName());
        map.put("pass",userBean.getPass());
        map.put("head",String.valueOf( userBean.getHead()));
        map.put("phone",String.valueOf(userBean.getPhone()));
        return (HashMap<String, String>) map;
    }

    /*
     *函数名：HashMap
     * 功 能：返回主页列表
     * 参  数：String acount, String pass
     * 返回值：HashMap
     */
    public static HashMap<String, String> List(String year, String month, String day, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("year",year);
        map.put("month",month);
        map.put("day",day);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> Delect(String id) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("id",id);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> DayNum(String year, String month, String day, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("year",year);
        map.put("month",month);
        map.put("day",day);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> MonthNum(String year, String month, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put( "action","ShowMonth" );
        map.put("year",year);
        map.put("month",month);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    /* 统计当月的详情列表数据*/
    public static HashMap<String, String> MonthList(String year, String month, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("year",year);
        map.put("month",month);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    /* 统计当月的详情列表数据*/
    public static HashMap<String, String> MonthList(String year, String month,String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("year",year);
        map.put("month",month);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    /* 统计某年某月的收支情况数据*/
    public static HashMap<String, String> MonthInfo(String year, String month, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put( "action","ShowInfo" );
        map.put("year",year);
        map.put("month",month);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    //查询指定年份和月份的收入或者支出每一种类型的总钱数
    public static HashMap<String, String> MonthNums(String year, String month, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put( "action","ShowNum" );
        map.put("year",year);
        map.put("month",month);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    //获取这个月的最大金额
    public static HashMap<String, String> MonthMax(String year, String month, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put( "action","ShowMonthMax" );
        map.put("year",year);
        map.put("month",month);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    //获取这个月每天的支出总金额
    public static HashMap<String, String> DayNums(String year, String month, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put( "action","ShowNums" );
        map.put("year",year);
        map.put("month",month);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
    //更新信息
    public static HashMap<String, String> Update(String id, String money) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("id",id);
        map.put("money",money);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> GetEmail(String email) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("email",email);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> GetString2(String string1,String string2) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("string1",string1);
        map.put("string2",string2);
        return (HashMap<String, String>) map;
    }

    public static HashMap<String, String> GetString(String string1){
        Map<String, String> map = new HashMap<String, String>();
        map.put("string1",string1);
        return (HashMap<String, String>) map;
    }
    //添加支出账单
    public static HashMap<String, String> OutAdd(AccountBean accountBean){
        Map paramers=new HashMap();
        paramers.put("typename",accountBean.getTypename()+"");
        paramers.put("simageid",accountBean.getsImageId()+"");
        paramers.put("mainid",accountBean.getMainId()+"");
        paramers.put("beizhu",accountBean.getBeizhu()+"");
        paramers.put("money",accountBean.getMoney()+"");
        paramers.put("time",accountBean.getTime()+"");
        paramers.put("year",accountBean.getYear()+"");
        paramers.put("month",accountBean.getMonth()+"");
        paramers.put("day", accountBean.getDay()+"");
        paramers.put("kind",accountBean.getKind()+"");
        return (HashMap<String, String>) (HashMap<String, String>) paramers;

    }

    public static HashMap<String, String> linechart(String year, String kind, String mainId) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("year",year);
        map.put("kind",kind);
        map.put("mainId",mainId);
        return (HashMap<String, String>) map;
    }
}
